package com.xxx.blog.service.impl;

import com.xxx.blog.domain.Param;
import com.xxx.blog.mapper.ParamMapper;
import com.xxx.blog.service.IParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class ParamServiceImpl implements IParamService {
    @Autowired
    ParamMapper paramMapper;
    @Override
    public Map<String, String> getParamMap() {
        List<Param> paramList = paramMapper.getParamMap();
        HashMap<String, String> paramMap = new HashMap<>();
        for (Param param : paramList) {
            paramMap.put(param.getParamKey(), param.getParamValue());
        }
        return paramMap;
    }
}
